<?php

namespace module\open\controller;

use app\Controller;
use Firebase\JWT\JWT;

class Visitor extends Controller
{
    /**
     * 获取token.
     * 
     */
    public function token()
    {
        // 获取token
        $data = ['access_token' => Jwt::encode(['id' => config('http.account')], config('jwt.key'), input('jwt.method/s'))]; //参数为用户认证的信息，请自行添加
        redis()->set('ApiAccessToken', $data['access_token']);
        return json($data);
    }
}
